package com.example.eazytransfer.model;

import javafx.beans.property.*;
import javafx.beans.value.ObservableBooleanValue;
import javafx.beans.value.ObservableIntegerValue;
import javafx.beans.value.ObservableStringValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

public class ViewModel {
    private final static class Holder{
        static final ViewModel viewModel=new ViewModel();
    }
    public static ViewModel getInstance(){
        return Holder.viewModel;
    }
    //建立连接界面状态
    public BooleanProperty isServerModel=new SimpleBooleanProperty();//是否是服务端模式
    public BooleanProperty isServerStart=new SimpleBooleanProperty();//是否是服务端模式
    public BooleanProperty isConnected=new SimpleBooleanProperty();//是否已建立连接
    public StringProperty serviceIP=new SimpleStringProperty();
    public StringProperty servicePort=new SimpleStringProperty();
    public StringProperty connectIP=new SimpleStringProperty();
    public StringProperty connectPort=new SimpleStringProperty();
    //发送文件界面状态
    public ObservableList<String> filePathListForSend= FXCollections.observableArrayList();
    public StringProperty filePathItemBeSelected=new SimpleStringProperty();
    public StringProperty filePathOnSending=new SimpleStringProperty();
    public DoubleProperty sendingProgress=new SimpleDoubleProperty();
    public StringProperty sendingProgressPercent =new SimpleStringProperty();
    //接收文件界面状态
    public ObservableList<String> filePathListHasReceive= FXCollections.observableArrayList();
    public StringProperty dirForReceive=new SimpleStringProperty();
    public StringProperty filePathOnReceiving=new SimpleStringProperty();
    public DoubleProperty receivingProgress=new SimpleDoubleProperty();
    public StringProperty receivingProgressPercent =new SimpleStringProperty();


}
